using System;
using System.Collections.Generic;

namespace MvcCms.Data
{
    public interface ICmsRepository
    {
        //Content Category Methods
        ContentCategory GetContentCategory(int id);
        ContentCategory GetContentCategory(int id, string direction, bool issubcat, Portal portal);
        ContentCategory GetContentCategoryByPath(string path, Portal portal);
        ContentCategory GetContentCategoryByFullPath(string path, Portal portal);
        Redirect GetRedirect(string path, Portal portal);
        Redirect GetGlobalRedirect(string path);
        ContentCategory EditContentCategory(ContentCategory categoryToEdit);
        int CreateContentCategory(ContentCategory contentcategoryToCreate);

        IEnumerable<ContentCategory> ListCategories(Portal portal);
        IEnumerable<ContentCategory> ListAllCategories();
        IEnumerable<ContentCategory> ListAllCategoriesWithPages();
        IEnumerable<ContentCategory> ListCategoriesForBackOffice(Portal portal);
        IEnumerable<DTOSubCategory> ListSubCats(int catId);

        void DeleteContentCategory(ContentCategory categoryToDelete);
        void SetPublishedPage(int contentPageId);

        //Content Page Methods
        ContentPage GetContentPage(int id);
        ContentPage GetContentPage(int id, string direction);
        DTOPage GetDTOContentPage(int id);
        ContentComment GetContentComment(int id);

        ContentPage GetPublishedCatContentPageByCategory(int catId);
        DTOPage GetAltLanguagePage(int languageId, int parentPageId);
        ContentPage GetAltLanguagePageForCMS(string languagePathId, int parentPageId);

        DTOPage GetCurrentPageForCategory(int catId);

        ContentPage EditContentPage(ContentPage pageToEdit);
        ContentComment EditContentComment(ContentComment contentcommentToEdit);
        int CreateContentPage(ContentPage contentpageToCreate);
        ContentComment CreateContentComment(ContentComment contentcommentToCreate);

        IEnumerable<DTOContentPageForEditor> ListPages(int portalId);
        IEnumerable<DTOContentPageForEditor> ListPages(Guid contributorId);
        IEnumerable<ContentPage> ListPagesByCat(int catId, Portal portal);
        IEnumerable<DTOContentComment> ListContentComments(int pageId);
        IEnumerable<DTOContentComment> ListContentCommentReplies(int commentId);
        IEnumerable<ContentPage> ListCategoryPagesByCategory(int catId, Portal portal);
        IEnumerable<ContentPage> ListSubPages();
        IEnumerable<ContentPage> ListAltLanguagePages();
        IEnumerable<ContentComment> ListContentComments(Guid userId);

        IEnumerable<DTOPage> ListPagesForCategory(int catId);
        IEnumerable<DTOPage> ListUnpublishedPagesForCategory(int catId);
        void DeleteContentPage(ContentPage pageToDelete);
        void DeleteContentComment(ContentComment commentToDelete);

        //Module Methods
        Module GetModule(int moduleId);
        Module CreateModule(Module moduleToCreate);
        IEnumerable<Module> ListModules(Portal currentPortal);
        IEnumerable<DTOModule> ListModulesForPage(int pageId, Portal currentPortal);
        IEnumerable<WeightedContentModule> ListWeightedContentModulesForCache();
        void DeleteModule(int moduleId);
        Module EditModule(Module moduleToEdit);

        Widget GetWidget(int widgetId);
        Widget CreateWidget(Widget widgetToCreate);
        IEnumerable<Widget> ListWidgets(Portal currentPortal);
        IEnumerable<Widget> ListWidgetsForPage(int pageId, Portal currentPortal);
        IEnumerable<Widget> ListWidgetsForZones(Portal currentPortal);
        IEnumerable<WeightedContentWidget> ListWeightedContentWidgetsForCache();
        void DeleteWidget(int widgetId);
        Widget EditWidget(Widget widgetToEdit);

        WeightedContent GetWeightedContent(int weightedContentId);
        WeightedContent CreateWeightedContent(WeightedContent weightedContentToCreate);
        IEnumerable<WeightedContent> ListWeightedContents(Portal currentPortal);
        IEnumerable<WeightedContentModule> ListWeightedContentModules(Portal currentPortal);
        void DeleteWeightedContent(int weightedContentId);
        WeightedContent EditWeightedContent(WeightedContent weightedContentToEdit);

        Redirect CreateRedirect(Redirect redirectToCreate);
        IEnumerable<Redirect> ListRedirects(int portalId);
        Redirect EditRedirect(Redirect redirectToEdit);
    }
}